<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>添加管理员</title>
    <meta content="webkit" name="renderer">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"
          name="viewport"/>
    <link href="../ladmin/favicon.ico" rel="shortcut icon" type="image/x-icon"/>
    <link href="../ladmin/css/font.css" rel="stylesheet">
    <link href="../ladmin/css/xadmin.css" rel="stylesheet">
    <script src="../ladmin/js/jquery.min.js"></script>
    <script src="../ladmin/lib/layui/layui.js"></script>
    <script src="../ladmin/js/xadmin.js" type="text/javascript"></script>
    <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
    <script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
    <link href="../ladmin/lib/layui/css/modules/layer/default/layer.css" rel="stylesheet" type="text/css">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body class="form-wrap">
<div class="layuiWindownContent">
    <div class="layui-form" lay-filter="indexUPdatePWFrom">
        <div class="layui-form-item layui-col-lg6">
            <label class="layui-form-label">学号<font color="red">*</font></label>
            <div class="layui-input-block">
                <input autocomplete="off" class="layui-input" id="id"
                       lay-verify="pass" maxlength="12" minlength="12"
                       name="id" placeholder="请填写学号" type="text">
                <span id='notice1'></span>
            </div>

        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn  layui-btn-primary" id="addAdmin">添加管理员</button>
                <button class="layui-btn  layui-btn-primary" id="cancel">取消</button>

            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    function addAdmin() {
        var sendData = {
            id: $("input[id='id']").val()
        };
        $.ajax({

            type: 'POST',
            url: 'addAdmin',
            async: true,
            traditional: true,
            data: JSON.stringify(sendData),
            dataType: 'Text',
            contentType: "application/json;charset=UTF-8",
            /* beforeSend:function(){

                     return true;



             },*/
            success: function (data) {
                if (data == "true") {
                    layer.msg("添加成功");
                    setTimeout(function () {
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);//关闭当前页

                    }, 1500);
                } else
                    layer.msg("添加失败，该成员不存在或者有更高权限");

            }

        });
    }

    $(function () {

        $("#addAdmin").click(function () {
            addAdmin();
            return false;
        });
        $("#cancel").click(function () {

            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);//关闭当前页
            return false;
        })

    })
</script>


<style id="LAY_layadmin_theme">.layui-side-menu, .layadmin-pagetabs .layui-tab-title li:after, .layadmin-pagetabs .layui-tab-title li.layui-this:after, .layui-layer-admin .layui-layer-title, .layadmin-side-shrink .layui-side-menu .layui-nav > .layui-nav-item > .layui-nav-child {
    background-color: #20222A !important;
}

.layui-nav-tree .layui-this, .layui-nav-tree .layui-this > a, .layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a {
    background-color: #009688 !important;
}

.layui-layout-admin .layui-logo {
    background-color: #20222A !important;
}</style>
</body>


</html>